<template>
  <div>
    <center>
      <div><h2>欢迎注册</h2></div>
      <div id="registForm">
        <el-form ref="form" :model="form" label-width="80px">
          <el-form-item label="用户名">
            <el-input v-model="user.username"></el-input>
          </el-form-item>
          <el-form-item label="密码">
            <el-input v-model="user.password"></el-input>
          </el-form-item>
          <!-- 单选样式 -->
          <el-form-item label="性别">
            <el-radio-group v-model="user.gender">
              <el-radio label="男" value="1"></el-radio>
              <el-radio label="女" value="0"></el-radio>
            </el-radio-group>
          </el-form-item>
          <!-- 开关样式 -->
          <el-form-item label="是否管理员">
            <el-switch v-model="user.isAdmin"></el-switch>
          </el-form-item>
          <el-form-item>
            <el-button type="primary" @click="regist">立即注册</el-button>
            <el-button>取消</el-button>
          </el-form-item>
        </el-form>
      </div>
    </center>
  </div>
</template>

<script>
  export default {
    name: "Regist",
    data() {
      return {
        user: {
          username: '',
          password: '',
          gender: 1,
          isAdmin: false
        }
      }
    }
  }
</script>

<style scoped>
  #registForm {
    width: 600px;
  }
</style>
